package com.services.dao;

import org.junit.Assert;
import static org.junit.Assert.*;
import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/appcontext-config.xml"} )
public class DepartmentsDaoTest {
    
    @Autowired
    private DepartmentsDao departmentsDao;

    /**
     * @see DepartmentsDao#findByDepartmentId(long)
     */
    @Test
    @Transactional
    public void testFindByDepartmentId() {
        try{
            long deptId = 10;
            departmentsDao.findByDepartmentId(deptId);
            System.out.print("*SUCCESFULL");
        }catch(Exception e) {
            e.printStackTrace();
            Assert.fail("");
        }
    }
}
